package com.mdd.front.validate.salesman;

import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 推销员参数
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SalesmanParam implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface create{}
    public interface update{}
    public interface delete{}

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Integer id;

    @NotNull(message = "userId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "userId参数值不能少于0", groups = {create.class, update.class})
    private Integer userId;

    @NotNull(message = "name参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "name参数不能超出255个字符", groups = {create.class, update.class})
    private String name;

    @NotNull(message = "mobile参数缺失", groups = {create.class, update.class})
    @Length(max = 11, message = "mobile参数不能超出11个字符", groups = {create.class, update.class})
    private String mobile;

    @NotNull(message = "zone参数缺失", groups = {create.class, update.class})
    private Integer zone;

    @NotNull(message = "discount参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "discount参数值不能少于0", groups = {create.class, update.class})
    private BigDecimal discount;

    private Integer status; // 状态

}
